package com.kasax.ipcbus.utils;

import com.google.gson.Gson;

import java.lang.reflect.Type;

public class GsonUtils {
    private static final Gson gson = new Gson();

    public static String toJson(Object object) {
        return gson.toJson(object);
    }

    public static <T> T fromJson(String src, Type typeOfSrc) {
        return gson.fromJson(src, typeOfSrc);
    }

    public static <T> T fromJson(String src, Class<T> typeOfSrc) {
        return gson.fromJson(src, typeOfSrc);
    }

}
